package com.glorystone.ins.dao;

import java.util.List;

import com.glorystone.ins.domain.CapitalRecord;
import com.glorystone.ins.vo.ChannelCountVo;
import org.apache.ibatis.annotations.Param;

public interface CapitalRecordMapper {
    int deleteByPrimaryKey(Long tid);

    int insert(CapitalRecord record);

    int insertSelective(CapitalRecord record);

    CapitalRecord selectByPrimaryKey(Long tid);

    int updateByPrimaryKeySelective(CapitalRecord record);

    int updateByPrimaryKey(CapitalRecord record);

    List<CapitalRecord> selectRecordByOrderId(Long orderId);

    Integer insertList(@Param("capitalRecords") List<CapitalRecord> capitalRecords);

    CapitalRecord selectCapitalRecord(@Param("orderId") Long orderId, @Param("opponentType") Integer opponentType, @Param("tradeType") Integer tradeType);

    /**
     * 查询渠道待结算返佣费合计
     * @param channelId
     * @return
     */
    ChannelCountVo queryOpenAccount(@Param("channelId") Long channelId);
    /**
     * 查询已结算返佣费合计
     * @param channelId
     * @return
     */
    ChannelCountVo querySettleAccount(@Param("channelId") Long channelId);
    /**
     * 查询待还保费合计
     * @param channelId
     * @return
     */
    ChannelCountVo queryStayPremiumCount(@Param("channelId") Long channelId);
    /**
     * 查询退保待扣赚钱返佣费合计
     * @param channelId
     * @return
     */
    ChannelCountVo queryUnsureStayAccount(@Param("channelId") Long channelId);
    /**
     * 查询退保待扣赚钱返佣费合计
     * @param channelId
     * @return
     */
    ChannelCountVo queryUnsureSettleAccount(@Param("channelId") Long channelId);

}